<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主页</title>
</head>
<body background="background.jpeg" th:background="@{assets/images/background.jpeg}">
    <h1 align="center">欢迎光临小区物业基站合同管理系统</h1>
    <div sec:authorize="!isAuthenticated()">
     <h2 align = "center">游客您好，若想进入系统<a th:href="@{/login}">请登录</a></h2>
    </div>
    <div sec:authorize="isAuthenticated()">
      <h2><span sec:authentication="name"></span>您好，您的角色有
      <span sec:authentication="principal.authorities"></span></h2>
      <form th:action="@{/logout}" method = "post">
        <input type="submit" value ="注销"/>
    </form>
     </div>
  <hr>
  
  <div sec:authorize="hasRole('USER')">
    <h3><a th:href="@{/hetongmanage}">合同管理</a></h3>
  </div>
  
  <div sec:authorize="hasRole('ADMIN')">
  <h3>系统管理</h3>
    <ul>
       <li><a th:href="@{/system/location}">楼区管理</a></li>
       <li><a th:href="@{/system/unit}">单元管理</a></li>
       <li><a th:href="@{/system/house}">房屋管理</a></li>
    </ul>
  </div>
    
    
</body>
</html>